package com.ideafactory.client.br;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Message;

import com.ideafactory.client.xmpp.Constants;
import com.ideafactory.client.ybservice.ybviewpager.GoodsPayPager;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by LiuShao on 2016/4/26.
 */
public class PayingBroadcast extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String string = intent.getStringExtra(Constants.NOTIFICATION_MESSAGE);
        System.out.println("-------------------------" + string);
        try {
            JSONObject jsonObject = new JSONObject(string);
            Message message = new Message();
            message.what = 2;
            message.obj = jsonObject.toString();
            GoodsPayPager.mPayingHandler.sendMessage(message);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
